package project;

public class GTest<T> {
    private T item;
    private GTest<T> next;
    public T getItem(){
        return this.item;
    }
    public GTest<T> getNext(){
        return this.next;
    }
    public void add(T item){
        if(this.item==null){
            this.item=item;
        }else {
            if (this.next==null){
                this.next=new GTest<T>();
                this.next.add(item);
            }else {
                this.next.add(item);
            }
        }
    }
}
